package com.audaque.springboot.foshanupload.web.httpclientdemo.ieg.product.model;

import com.google.common.collect.Lists;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Objects;

/**
 * @author zgb
 * @date 2023/12/18
 */
public enum IegProductStageEnum {


    ALL(Lists.newArrayList(1, 2, 3, 4), "全阶段适用"),

    CONCEPT(Lists.newArrayList(1), "概念阶段"),
    RESEARCH_DEVELOPMENT(Lists.newArrayList(2), "研发阶段"),
    TEST(Lists.newArrayList(3), "测试阶段"),

    OPERATE(Lists.newArrayList(4), "运营阶段")
    ;

    @Getter
    private final List<Integer> code;
    @Getter
    private final String name;

    IegProductStageEnum(List<Integer> code, String name) {
        this.code = code;
        this.name = name;
    }



    public static IegProductStageEnum parseByName(String name){
        if(StringUtils.isBlank(name)){
            return null;
        }
        for(IegProductStageEnum at: IegProductStageEnum.values()){
            if(Objects.equals(at.name, name)){
                return at;
            }
        }
        return null;
    }




}
